package com.zzyy.study;

import java.util.concurrent.Semaphore;

/**
 * @auther zzyy
 * @create 2024-04-18 11:03
 */
public class IntegerDemo
{
    public static void main(String[] args)
    {
        Integer number1 = 10;
        Integer number2 = 10;
        Integer number3 = Integer.valueOf(10);
        Integer number4 = 300;
        Integer number5 = 300;

        //对于 Integer var = ? 在 -128 至 127 之间的赋值，
        // Integer 对象是在 IntegerCache.cache 产生，会复用已有对象
        System.out.println(number1 == number2);
        System.out.println(number1 == number3);
        System.out.println(number2 == number3);

        System.out.println(number4 == number5);
    }
}
